package com.santiao.fuel.dialog

import android.content.Context
import android.widget.FrameLayout
import android.widget.ImageView
import android.widget.TextView
import com.santiao.fuel.R

import com.lxj.xpopup.core.CenterPopupView

class ExitDialogPopup(context: Context) : CenterPopupView(context){
    var listener: OnExitClickListener? = null



    override fun getImplLayoutId(): Int {
        return R.layout.popup_exit_dialog
    }

    lateinit var feed_container_exit_dialog:FrameLayout

    override fun onCreate() {
        super.onCreate()

        var exit_tv_cancel = findViewById<ImageView>(R.id.exit_tv_cancel)
        var exit_tv_cancel1 = findViewById<TextView>(R.id.exit_tv_cancel1)
        var exit_tv_check = findViewById<TextView>(R.id.exit_tv_check)
        feed_container_exit_dialog = findViewById<FrameLayout>(R.id.feed_container_exit_dialog)
        exit_tv_cancel.setOnClickListener {
            dismiss()
            listener?.closeDialog()
        }
        exit_tv_cancel1.setOnClickListener {
            dismiss()
            listener?.cancel()
        }

        exit_tv_check.setOnClickListener {
            dismiss()
            listener?.ok()
        }

    }

    override fun onShow() {
        super.onShow()
    }


    override fun onDismiss() {

        super.onDismiss()

    }



    interface OnExitClickListener {
        fun cancel()
        fun closeDialog()
        fun ok()
    }
}